
@extends('layouts.master3')
@section('title')
{{"设置"}}
@stop
@section('content')
<?php
$arr=explode("|",Auth::user()->location);
if(count($arr)<2)
{
  $pro="-请选择-";
  $city="-请选择-";
}
else
{
   $pro=$arr[0];
   $city=$arr[1];
}
?>
<script src="/js/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="/js/city.js"></script>
    <style type="text/css">
            /* CSS used here will be applied after bootstrap.css */
body {
  background-color: #eaeaea;
  margin:0 auto; 
 width:100%;
}

img.avatar,
div.avatar {
  border: 1px solid #eee;
  width: 122px;
  height: 122px;
}

.btn-file {
  position: relative;
  overflow: hidden;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}
        </style>
    <!-- HTML code from Bootply.com editor -->
    

<?= Form::open(['url' => action('UsersController@index'), 'method' => 'POST', 'files' => true]) ?>
  <div class="container">
    <div class="row">
      <div class="col-md-9">
        <div class="panel panel-default">
          <div class="panel-body">
            <div class="row">
              <div class="col-md-12 lead">
                设置
		<small><font color="red">{{$message or ""}}</font></small>
                <hr>
              </div>
            </div>
            <div class="row">
              <div class="col-md-4 text-center">
                <div id="img-preview-block"  class="img-circle avatar avatar-original center-block" style="background-size:cover;background-image:url({{Auth::user()->avatar->url() }})"></div>
                <br> 
                <span class="btn btn-link btn-file">更改头像 <input id="upload-img" name="avatar" type="file"></span>
              </div>
              <div class="col-md-8">
                <div class="form-group">
                </div>
	  <div class="form-group">
                  <label for="user_first_name">email</label>
                  <input class="form-control" name="email" disabled type="text" value="{{Auth::user()->email}}">
                </div>

                <div class="form-group">
                  <label for="user_first_name">昵称</label>
                  <input class="form-control" name="name" type="text" value="{{Auth::user()->name}}">
                </div>
                <div class="form-group">
                  <label for="user_middle_name">公司</label>
                  <input class="form-control" name="company" type="text" value="{{Auth::user()->company}}">
                </div>
                <div class="form-group">
                  <label for="user_middle_name">职位</label>
                  <input class="form-control" name="title" type="text" value="{{Auth::user()->title}}">
                </div>
		<div class="form-group">
		<label for="user_middle_name">所在地</label>
<div class="row">
<div class="col-sm-3">
<select class="form-control"  id="pro" name="pro">
    	<option>{{$pro}}</option>
        <option>北京市</option>
        <option>上海市</option>
        <option>天津市</option>
        <option>重庆市</option>
        <option>河北省</option>
        <option>山西省</option>
        <option>内蒙古自治区</option>
        <option>辽宁省</option>
        <option>吉林省</option>
        <option>黑龙江省</option>
        <option>江苏省</option>
        <option>浙江省</option>
        <option>安徽省</option>
        <option>福建省</option>
        <option>江西省</option>
        <option>山东省</option>
        <option>河南省</option>
        <option>湖北省</option>
        <option>湖南省</option>
        <option>广东省</option>
        <option>广西壮族自治区</option>
        <option>海南省</option>
        <option>四川省</option>
        <option>贵州省</option>
        <option>云南省</option>
        <option>西藏自治区</option>
        <option>陕西省</option>
        <option>甘肃省</option>
        <option>宁夏回族自治区</option>
        <option>青海省</option>
        <option>新疆维吾尔族自治区</option>
        <option>香港特别行政区</option>
        <option>澳门特别行政区</option>
        <option>台湾省</option>
        <option>其它</option>
    </select>
</div>
<div class="col-sm-3">
    <select class="form-control"  id="city" name="city">
    	<option>{{$city}}</option>
    </select>
</div>
</div>
		</div>
              <!--  <div class="radio">
                  <label class="radio-inline">
                    <input value="male" checked="checked" name="user[gender]" id="user_gender_male" type="radio">Мужской
                  </label>
                  <label class="radio-inline">
                    <input value="female" name="user[gender]" id="user_gender_female" type="radio">Женский
                  </label>
                  <label class="radio-inline">
                    <input value="other" name="user[gender]" id="user_gender_other" type="radio">Другое
                  </label>
                </div> -->
                
                
              </div>
            </div>
            <div class="row">
              <div class="col-md-12">
                <hr>
                <button class="btn btn-primary pull-right"><i class="glyphicon glyphicon-floppy-disk"></i> 保存</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div id="delete-user-modal" class="modal fade">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-body">
          <p>Are you sure you want to delete account?</p>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
<?= Form::close() ?>
        


        
        <!-- JavaScript jQuery code from Bootply.com editor  -->
        
        <script type='text/javascript'>
        
        $(document).ready(function() {
        
            $(function() {
    $("#upload-img").on("change", function()
    {
        var files = !!this.files ? this.files : [];
        if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support
 
        if (/^image/.test( files[0].type)){ // only image file
            var reader = new FileReader(); // instance of the FileReader
            reader.readAsDataURL(files[0]); // read the local file
 
            reader.onload = function(e){ // set image data as background of div
              
              $("#img-preview-block").css({'background-image': 'url('+e.target.result +')', "background-size": "cover"});
            }
        }
    });
});
        
        });
        
        </script>
        
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          ga('create', 'UA-40413119-1', 'bootply.com');
          ga('send', 'pageview');
        </script>
        
@stop
